package com.ruoyi.location.repository.generator.mapper;

import com.ruoyi.location.repository.generator.entity.LocationPhoneLoginCode;
import com.ruoyi.location.repository.generator.entity.LocationPhoneLoginCodeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface LocationPhoneLoginCodeMapper {
    @SelectProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="countByExample")
    long countByExample(LocationPhoneLoginCodeExample example);

    @DeleteProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="deleteByExample")
    int deleteByExample(LocationPhoneLoginCodeExample example);

    @Delete({
        "delete from location_phone_login_code",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into location_phone_login_code (phoneNum, msg_code, ",
        "ctime)",
        "values (#{phonenum,jdbcType=BIGINT}, #{msgCode,jdbcType=VARCHAR}, ",
        "#{ctime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(LocationPhoneLoginCode row);

    @InsertProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(LocationPhoneLoginCode row);

    @SelectProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="phoneNum", property="phonenum", jdbcType=JdbcType.BIGINT),
        @Result(column="msg_code", property="msgCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="ctime", property="ctime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<LocationPhoneLoginCode> selectByExample(LocationPhoneLoginCodeExample example);

    @Select({
        "select",
        "id, phoneNum, msg_code, ctime",
        "from location_phone_login_code",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="phoneNum", property="phonenum", jdbcType=JdbcType.BIGINT),
        @Result(column="msg_code", property="msgCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="ctime", property="ctime", jdbcType=JdbcType.TIMESTAMP)
    })
    LocationPhoneLoginCode selectByPrimaryKey(Long id);

    @UpdateProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") LocationPhoneLoginCode row, @Param("example") LocationPhoneLoginCodeExample example);

    @UpdateProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") LocationPhoneLoginCode row, @Param("example") LocationPhoneLoginCodeExample example);

    @UpdateProvider(type=LocationPhoneLoginCodeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(LocationPhoneLoginCode row);

    @Update({
        "update location_phone_login_code",
        "set phoneNum = #{phonenum,jdbcType=BIGINT},",
          "msg_code = #{msgCode,jdbcType=VARCHAR},",
          "ctime = #{ctime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(LocationPhoneLoginCode row);
}